<?php
header('Content-type:text/html;charset=utf-8;');

//包含数据库配置
include '../../public/peizhi.php';

//包含函数
include '../../public/func.php';

//调用函数
$link = db();

//接值准备SQL语句
if(!empty($_REQUEST['lk_id'])){
	$lk_id = $_REQUEST['lk_id'];
		if(is_array($lk_id)){
			$lkid = implode(',',$lk_id);
			$sql = "delete from link where id in({$lkid})";
		}else{
			$lkid = $lk_id;
			$sql = "delete from link where id in({$lkid})";
		}
}else{
	exit('<script>alert("没有友情链接或没有选择友情链接");window.location.href="show.php";</script>');
}

//执行SQL语句
if($res = mysqli_query($link,$sql)){
	echo '<script>alert("删除友情链接成功");window.location.href="show.php";</script>';
}else{
	echo '<script>alert("删除友情链接失败");window.location.href="show.php";</script>';
}

//关闭数据库连接
mysqli_close($link);




